﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MeetIterator
{
    class DinnerMenuIterator : Iterator
    {
        MenuItem[] items;
        int position = 0;
        public DinnerMenuIterator(MenuItem[] items)
        {
            this.items = items;
        }
        public bool hasNext()
        {
            if(position >= items.Length || items[position] == null)
            {
                return false;
            }
            else
            {
                return true;
            }
        }

        public object next()
        {
            MenuItem menuItem = items[position];
            position++;
            return menuItem;
        }
    }
}
